package com.ayf.payment.game.api.service.platform;

import com.ayf.payment.game.api.dto.platform.MerchantChannelDTO;
import com.ayf.payment.game.api.dto.platform.MerchantPaymentProductDTO;
import com.ayf.payment.game.api.dto.platform.PaymentChannelDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface PaymentChannelService {
    @Transactional
    void insertPaymentChannel(PaymentChannelDTO dto);

    /**
     * 查询所有通道数据
     * @return
     */
    List<PaymentChannelDTO> getAllPaymentChannel();

    /**
     * 查询所有通道数据
     * @return
     */
    List<PaymentChannelDTO> selectPaymentChannelByType(int cType);

    /**
     * 单通道数据详情
     * @param id
     * @return
     */
    PaymentChannelDTO getPaymentChannelDTO(int id);

    /**
     * 更新通道数据
     * @param paymentChannelDTO
     */
    @Transactional
    void updatePaymentChannel(PaymentChannelDTO paymentChannelDTO);

    /**
     * 修改通道URL 回调
     * @param paymentChannelDTO
     */
    @Transactional
    void updatePaymentChannelUrl(PaymentChannelDTO paymentChannelDTO);

    /**
     * 更新通道产品费率
     * @param paymentChannelDTO
     */
    @Transactional
    void updatePaymentChannelRate(PaymentChannelDTO paymentChannelDTO);

    /**
     * 修改通道状态
     * @param paymentChannelDTO
     */
    @Transactional
    void updatePaymentChannelStatus(PaymentChannelDTO paymentChannelDTO);

    /**
     * 更新平台密钥对
     * @param paymentChannelDTO
     * @return
     */
    @Transactional
    String updatePlatformKey(PaymentChannelDTO paymentChannelDTO);

    /**
     * 更新商户选择通道
     * @param merchantChannelDTO
     */
    @Transactional
    void updateMerchantChannel(MerchantChannelDTO merchantChannelDTO);

    /**
     * 得到商户支付通道ID
     * @param merchantChannelDTO
     * @return
     */
    Integer[] getPaymentChannelByMerchantId(MerchantChannelDTO merchantChannelDTO);

    /**
     * 得到默认通道ID
     * @return
     */
    Integer[] getPaymentChannelByDefault();

    /**
     * 获取所有通道数据
     * @return
     */
    List<PaymentChannelDTO> selectPaymentChanne();

    PaymentChannelDTO getPaymentChanneByCId(Integer cId);

    /**
     * 获取所有支付产品
     * @return
     */
    List<MerchantPaymentProductDTO> selectMerchantPaymentProduct(Integer channelId);

    /**
     * 根据产品ID获取支付产品
     * @param pId
     * @return
     */
    MerchantPaymentProductDTO getMerchantPaymentProductByPId(Integer pId);

    /**
     * 单通道数据详情 通过code获取
     * @param code
     * @return
     */
    PaymentChannelDTO getPaymentChannelByCode(String code);

    PaymentChannelDTO getPaymentChannelById(Integer id);

}

